package com.itheima.reflect;

import java.lang.reflect.Constructor;

public class ReflactDemo2 {
    public static void main(String[] args) throws NoSuchMethodException {
        Class c = Student.class;
        Constructor[] c1 = c.getConstructors();
        for (Constructor constructor : c1) {
            System.out.println(constructor);
        }
        Constructor c4 = c.getConstructor();
        System.out.println("c4 = " + c4);

        Constructor c2 = c.getDeclaredConstructor(String.class);
        System.out.println("c2 = " + c2);

        Constructor[] c3 = c.getDeclaredConstructors();
        for (Constructor constructor : c3) {
            System.out.println(constructor);
        }
    }
}
